package com.yunfei.api.user.valid;

import com.yunfei.api.user.contants.ApiValitationConstantMessage;
import com.yunfei.api.user.contants.ValitationConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;

/**
 * @program: zntg_v1
 * @description:
 * @author: zhengyunfei
 * @create: 2018-10-30 10:48
 **/
@Data
public class LoginForm implements java.io.Serializable{
    @ApiModelProperty(value = "手机号", required = true)
    @NotBlank(message = ApiValitationConstantMessage.MOBILE_NOTNULL_MESSAGE)
    @Length(min = 11,max = 11,message = ApiValitationConstantMessage.MOBILE_REG_MESSAGE)
    @Pattern(regexp= ValitationConstant.MOBILE_REG, message= ApiValitationConstantMessage.MOBILE_REG_MESSAGE)
    private String mobile;
    @ApiModelProperty(value = "短信验证码", required = true,example = "0000")
    @NotBlank(message = ApiValitationConstantMessage.VCODE_NOTNULL_MESSAGE)
    private String vcode;

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getVcode() {
        return vcode;
    }

    public void setVcode(String vcode) {
        this.vcode = vcode;
    }
}
